package apiday02;

public class RegDemo05 {
    public static void main(String[] args) {
        /**
         * 测试 如何匹配 域名 www.tedu.cn
         */
        String reg1 = "www.tedu.cn";
        String reg2 = "www\\.tedu\\.cn";

        String s1 = "www.tedu.cn";
        String s2 = "wwwateduacn";
        String s3 = "www-tedu-cn";
        System.out.println(s1.matches(reg1));
        System.out.println(s1.matches(reg2));
        System.out.println(s2.matches(reg2));
        System.out.println(s2.matches(reg1));
        System.out.println(s3.matches(reg1));
        System.out.println(s3.matches(reg2));
    }
}
